<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><html lang="en">
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<html>

<head>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <link href="css/index.css" rel="stylesheet">
</head>

<body>
<%@include file="nav.jsp"%>
<%@include file="header.jsp"%>
<div class="boughtDiv">
    <div class="orderType">
        <div class="selectedOrderType"><a orderStatus="all" href="#nowhere">所有订单</a></div>
        <div><a  orderStatus="waitPay" href="#nowhere">待付款</a></div>
        <div><a  orderStatus="waitDelivery" href="#nowhere">待发货</a></div>
        <div><a  orderStatus="waitConfirm" href="#nowhere">待收货</a></div>
        <div><a  orderStatus="waitReview" href="#nowhere" class="noRightborder">待评价</a></div>
        <div class="orderTypeLastOne"><a class="noRightborder"> </a></div>
    </div>
    <div style="clear:both"></div>
    <div class="orderListTitle">
        <table class="orderListTitleTable">
            <tr>
                <td>宝贝</td>
                <td width="100px">单价</td>
                <td width="100px">数量</td>
                <td width="120px">实付款</td>
                <td width="100px">交易操作</td>
            </tr>
        </table>

    </div>

    <fmt:setLocale value="zh_CN"/>

    <div class="orderListItem">

        <c:forEach items="${orders}" var="o">
        <table class="orderListItemTable" orderStatus="waitReview" oid="965">
            <tr class="orderListItemFirstTR">
                <td colspan="2">
                    <b>
    <%--                        <fmt:formatDate value="${o.gmtCreate}"/></b>--%>
                        <fmt:formatDate value="${o.gmtCreate}" type="both"
                                        pattern="yyyy年MM月dd日 HH时mm分ss秒" var="dateStr" />

                        ${dateStr}
                    </b>
                    <span>订单号: ${o.id}
					</span>
                    <span>
                        总价:${o.totalPrice}
                    </span>
                </td>
                <td  colspan="2"><img width="13px" src="img/site/orderItemTmall.png">天猫商场</td>
                <td colspan="1">
                    <a class="wangwanglink" href="#nowhere">
                        <div class="orderItemWangWangGif"></div>
                    </a>

                </td>
                <td class="orderItemDeleteTD">
                    <a class="deleteOrderLink" oid="965" href="#nowhere">
                        <span  class="orderListItemDelete glyphicon glyphicon-trash"></span>
                    </a>

                </td>
            </tr>

            <c:forEach items="${o.itemList}" var="item">
            <tr class="orderItemProductInfoPartTR" >
                <td class="orderItemProductInfoPartTD"><img width="80" height="80" src="${item.product.pic}"></td>
                <td class="orderItemProductInfoPartTD">
                    <div class="orderListItemProductLinkOutDiv">
                        <a href="#nowhere">${item.product.name}</a>
                        <div class="orderListItemProductLinkInnerDiv">
                            <img src="img/site/creditcard.png" title="支持信用卡支付">
                            <img src="img/site/7day.png" title="消费者保障服务,承诺7天退货">
                            <img src="img/site/promise.png" title="消费者保障服务,承诺如实描述">
                        </div>
                    </div>
                </td>
                <td  class="orderItemProductInfoPartTD" width="100px">

                    <div class="orderListItemProductOriginalPrice">￥10,012.00</div>
                    <div class="orderListItemProductPrice">￥${item.price}</div>

                </td>

                <td valign="top" rowspan="1" class="orderListItemNumberTD orderItemOrderInfoPartTD" width="100px">
                    <span class="orderListItemNumber">${item.count}</span>
                </td>
                <td valign="top" rowspan="1" width="120px" class="orderListItemProductRealPriceTD orderItemOrderInfoPartTD">
                    <div class="orderListItemProductRealPrice">￥${item.totalPrice}</div>
                    <div class="orderListItemPriceWithTransport">(含运费：￥0.00)</div>
                </td>
                <td valign="top" rowspan="1" class="orderListItemButtonTD orderItemOrderInfoPartTD" width="100px">


                    <c:choose>
                        <c:when test="${o.status=='待支付'}">
                            <a href="#nowhere">
                                <button  class="orderListItemReview">去支付</button>
                            </a>

                        </c:when>
                        <c:when test="${o.status=='待商家发货'}">
                            <a href="#nowhere">
                                <button  class="orderListItemReview">评价</button>
                            </a>

                        </c:when>
                        <c:when test="${o.status=='商家已发货'}">

                            <a href="#nowhere">
                                <button  class="orderListItemReview">评价</button>
                            </a>
                        </c:when>
                        <c:when test="${o.status=='商家已发货'}">
                            <a href="#nowhere">
                                <button  class="orderListItemReview">评价</button>
                            </a>

                        </c:when>


                    </c:choose>


                </td>

            </tr>
            </c:forEach>
        </table>

        </c:forEach>

    </div>

</div>

<%@include file="footer.jsp"%>
</body>
</html>